The present disclosure relates to a communication device, a computer program product, a communication control method. More specifically, the present disclosure relates to a communication device, a computer program product, and a communication control method in which a communication path is established by call control communication.
A communication device is known that performs call control communication via a call control device, such as a server, and establishes a communication path with a partner communication device, thereby starting peer to peer (P2P) communication with the partner communication device. In call control communication, a request packet requesting communication path establishment may be transmitted from a calling-side communication device (hereinafter referred to as a “calling device”) to a partner communication device (hereinafter referred to as a “called device”). When the called device that has received the request packet permits communication path establishment with the calling device, the called device may transmit a positive response packet to the calling device. The calling device may receive the positive response packet. Thus, the communication path between the calling device and the called device may be established, and P2P communication may be started.
Before transmitting the request packet to the called device, the calling device may open a port that is used to perform P2P communication with the called device. The calling device may add a number (a port number) of the opened port to the request packet, and may transmit the request packet to the called device. The called device can use the port number added to the received request packet as a destination port number during P2P communication. In a case where the calling device cannot receive the positive response packet from the called device, the calling device may close the opened port. By immediately closing the unused port in this way, the calling device may inhibit the port from being used by an unspecified third party. Accordingly, it is possible to achieve improvement in security.
Request packets may be mutually transmitted by two communication devices around the same time. In this case, the communication device may be receive the request packet from the partner communication device before the communication device receives a positive response packet in response to the request packet transmitted by the communication device. For example, Request for Comments (RFC) 3261 defines a protocol to re-transmit a request packet to the called device after the respective communication devices wait for a random time period. A system is also known in which a communication device having a higher priority order of two communication devices re-transmits a request packet to the called device. Thus, even when request packets are transmitted from two communication devices around the same time, a communication path between the communication devices may be established.